package com.evildog.workspace.common.exception;


import com.evildog.workspace.common.enums.CommonCustomExceptionDesc;
import com.evildog.workspace.common.intefaces.ICustomExceptionDesc;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.http.HttpStatus;

/**
 * 前置条件错误
 *
 * 比如文章必须审核通过，才能发布文章
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class PreconditionException extends CommonException {

    private static final long serialVersionUID = 6801519635531297845L;

    public PreconditionException() {
        this(CommonCustomExceptionDesc.PRECONDITION_FAILED);
    }

    public PreconditionException(ICustomExceptionDesc responseStatus){
        super(responseStatus, HttpStatus.PRECONDITION_FAILED);
    }

}
